<template>
	<view class="s-page-wrapper is-100vh">
		<view class="input_content">
			<view class="has-mglr-10 ">

				<view class="input_item">
					<tui-icon name="qrcode" :size="20" color='#999999'></tui-icon>
					<input type="mobile" class="is_input" placeholder="请输入邀请码" v-model="invitationCode" maxlength="12"/>
				</view>

			</view>
		</view>

		<view class="loginbtn has-radius has-mgtb-20" @tap="check">
			<button>确 认</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				invitationCode: "",

			};
		},
		watch: {

		},
		onLoad() {

		},
		methods: {
			check: function() {
				console.log(this.invitationCode)
				this.tui.request('/app/user/inInvitation', 'POST',
						{
							invitationCode: this.invitationCode,
						},
						false, false, false, )
					.then(res => {
						if (res.errno == 0) {
							console.log(res.data)
							uni.navigateTo({
								url:`/pages/set/set`
							})
						} else {
							this.tui.toast(res.errmsg)
						}
					}).catch(err => {
						console.log(err)
					})
			}
		}
	}
</script>

<style>
	page {
		/* min-height: 100%; */
		background-color: #FFFFFF;
	}

	.uni-page-head {
		box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.1);
	}

	.reg {
		width: 100%;
		text-align: center;
		border-bottom: 1px solid #f1f1f1;
		padding-top: 25rpx;
		padding-bottom: 25rpx;
	}

	/* logo */
	.logo {
		text-align: center;
		margin: 50rpx auto 50rpx auto;
	}

	.logoimg {
		width: 200rpx;
		height: 200rpx;
		border-radius: 50%;
	}

	/* 表单 */
	/* input框 */
	.input_content {
		width: 85%;
		margin: 70px auto 0 auto;
	}

	.input_item {
		width: 100%;
		height: 88rpx;
		line-height: 88rpx;
		color: #999999;
		font-size: 14px;
		box-sizing: border-box;
		appearance: none;
		box-shadow: none;
		border-radius: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 30upx;
		background: $page-color-light;
		border: 2rpx solid #e5e5e5;
		outline: 0;
		font-family: inherit;
		background: #fff;
		resize: none;
		padding-left: 30rpx;
		padding-right: 30rpx;
		margin-bottom: 50upx;
	}

	.input_img {
		width: 20px;
		height: 20px;
	}

	.is_input {
		color: #999999;
		width: 100%;
		padding-left: 5px;
	}

	/* 获取验证码 */
	.codeimg {
		width: 150rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		color: #6E609E;
		background: #fff;
		font-size: 12px;
		position: absolute;
		right: 9%;
		z-index: 999;
		border-left: 1px solid #e5e5e5;
		border-top-right-radius: 44rpx;
		border-bottom-right-radius: 44rpx;
	}

	.input_con {
		display: flex;
		align-items: center;
		font-size: 12px;
		color: #999999;
		margin-bottom: 12px;
	}


	/* 按钮 */
	.loginbtn {
		width: 85%;
		margin: 10px auto;
	}

	.loginbtn button {
		margin-top: 20rpx;
		height: 88rpx;
		width: 100%;
		line-height: 88rpx;
		color: #ffffff;
		font-size: 32rpx;
		border-radius: 44rpx;
		outline: 0;
		display: block;
		margin: 0;
		font-family: inherit;
		background: #D14798;
	}

	button:after {
		border: 2rpx solid #f2f2f2;
	}
</style>
